<?php
class Model_Giaphong extends Zend_Db_Table_Abstract {
	protected $DataAp;
	public function __construct() {
		$this->DataAp = Zend_Registry::get ( "db" );
	}	
	public function getItems($id) {
		$result = array();        
		$query = $this->DataAp->query ( "SELECT id,`type`, `name`, priceParams FROM catalog where `type` = 'RoomType'" );
		 $data = $query->fetchAll ();
		return $data;
	}
	
	public function add($data) {
		$Id = $this->DataAp->insert ( 'catalog', $data );
		return $Id;
	} 
	public function update($id, $data) {
		$Id = $this->DataAp->update ( 'catalog', $data, 'id = ' . $id );
		return $Id;
	}
	public function del($id) {
		$Id = $this->DataAp->delete ( 'catalog', 'idtype = ' . $id );
		return $Id;
	}
}
?>
   
   

